<template>
  <div class="home">
    首页布局
    <div v-for="banner in state.banners" :key="banner.id">轮播图 {{ banner.image }}</div>
    <div v-for="recommend in state.recommends" :key="recommend.id">推荐商品 {{ recomment.title }}</div>
  </div>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'
import { getBanners, getRecommend } from '../../api/home'

const state = reactive(
  banners: [],
  recommends: []
)

const findData = () => {
  const [banners, recommends] = await Promise.all([
    getBanners(),
    getRecommend(),
  ])
  state.banners = banners
  state.recommends = recommends
}
</script>

<style lang="less" scoped></style>
